package com.xxx.yuedong.config;

import cn.dev33.satoken.stp.StpInterface;
import com.xxx.yuedong.mine.db.dao.UserDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;
@Component
public class StpUtilImpl implements StpInterface {
    @Autowired
    private UserDao userDao;
    @Override
    public List<String> getPermissionList(Object loginId, String loginKey) {
        long userId = Long.parseLong(loginId.toString());
        ArrayList<String> permissions = userDao.searchUserPermission(userId);
        return permissions;
    }

    @Override
    public List<String> getRoleList(Object o, String s) {
        ArrayList<String> list = new ArrayList<>();
        return list;
    }
}
